/*
 * Copyright (c) Jiandong.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


import { NativeModule } from './NativeModule';

interface Provider<T extends NativeModule> {

}

interface ReactModuleInfo {
  name():string
}

export class ModuleHolder {
    private mName: string;
    private mReactModuleInfo: ReactModuleInfo;

    private mProvider?: Provider<NativeModule> ;
    // Outside of the constructur, these should only be checked or set when synchronized on this
    private mModule?: NativeModule;

//    // These are used to communicate phases of creation and initialization across threads
//    private mInitializable: boolean;
//    private mIsCreating: boolean;
//    private mIsInitializing: boolean;

    public constructor(moduleInfo: ReactModuleInfo, provider: Provider<NativeModule>) {
      this.mName = moduleInfo.name();
      this.mProvider = provider;
      this.mReactModuleInfo = moduleInfo;
   }

    public getModule(): NativeModule {

        return this.mModule
    }

}
